<template>
  <div class="block container">
  <el-timeline>
    <el-timeline-item :timestamp="item.time" placement="top" v-for="item in timeData" :key="item.id">
      <el-card>
        <h4>{{item.title}}</h4>
        <el-popover
          placement="top-start"
          title=""
          width="200"
          trigger="hover"
          :content="item.content">
          <el-button slot="reference">查看详情</el-button>
        </el-popover>
      </el-card>
    </el-timeline-item>
    
  </el-timeline>
</div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      timeData:[
        
      ]
    }
  },
  methods: {
    textdata(){
      axios({
        url:'http://127.0.0.1:8000/json',
        // url:'https://ku.qingnian8.com/dataApi/blog/showBlog.php',
        methods:"get",
      }).then((res)=>{
        console.log(res.data)
        this.timeData=res.data
      })
    }
  },
  mounted(){
    this.textdata()
  }
}
</script>

<style lang="scss" scoped>
.block{
    background: #fff;
    margin: 0 auto;
    padding: 50px;
    border-radius: 30px;
    margin-top: 50px;
    margin-bottom: 50px;
    text-align: left;
}
</style>